#include<stdio.h>

int main(int argc, char* argv[])
{
    //mycat
    if(argc != 2)
    {
        printf("mycat:command no find\n");
        return 1;
    }

    FILE* fp = fopen(argv[1], "r");
    if(fp == NULL)
    {
        perror("fopen");
        return 2;
    }
    char line[64];
    while(fgets(line, sizeof line, fp) != NULL)
    {
        fprintf(stdout, line);
    }

    //FILE* fp = fopen("test.txt", "w");
    //if(fp == NULL)
    //{
    //    perror("fopen");
    //    return 1;
    //}
    //fputs("hello kele\n", fp);
    //fclose(fp);
    return 0;
}
